<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="author" content="">
    <title></title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
    <% include("../inc/input_css.html"){}%>
    <style>
        label{
            width: 140px!important;
        }
    </style>
    <%
    var isAdd = false;
    var isEdit = false;
    if(isEmpty(files.id)){
    isAdd = true;
    }else{
    isEdit = true;
    }%>
</head>

<body>
<div class="ibox">
    <div class="ibox-title">
        <div class="pull-left mbx navbar_title">
            <span class="current">素材管理</span>
            <span class="line">/</span>
            <span class="current"><a href="/shop/imgMeterial/list">素材管理</a></span><span class="line">/</span>
            <%if(isAdd){%>添加图片素材<%}else{%>编辑图片素材<%}%>
        </div>
    </div>
    <div class="ibox-content">
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="padding-40">
                    <form method="post" action="<%if (isAdd){%>${base}/shop/imgMeterial/save<%}else{%>${base}/shop/imgMeterial/update<%}%>"  class="form-horizontal form-validate">
                        <input type="hidden" name="files.id" value="${files.id!}">
                        <input type="hidden" name="orignImg" value="${files.url!}">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>图片名称</label>
                            <div class="col-sm-3">
                                <input type="text" name="files.originalName" value="${files.originalName!}" class="form-control input-sm" required="true">
                                <input type="hidden" name="demo.id" value="">
                            </div>
                        </div>
                        <%if(isAdd){%>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="maroon">*</span>上传图片</label>
                            <div class="col-sm-3">
                                <div id="image_upload" class="">
                                    <img class="img-rounded" style="max-height:50px;" src="${files.url!}"/>
                                    <input type="hidden" name="files.url" value="${files.url!}" class=" pull-left form-control input-sm" />
                                    <input type="button" class="button browserButton" value="选择文件" required="true"/>
                                </div>
                            </div>
                        </div>
                        <%}%>
                        <div class="form-group" style="margin-top: 24px">
                            <label class="col-sm-2 control-label "></label>
                            <div class="col-sm-4 col-sm-offset-0">
                                <button class="hive-btn-cancle" id="btn_cancle" type="button" onclick="history.back()">&nbsp;取消&nbsp;</button>
                                <button class="hive-btn hive-btn-primary margin-left-8" type="submit">&nbsp;提交&nbsp;
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<% include("../inc/input_js.html"){}%>

<!-- 自定义js -->
<script src="/res/js/jquery-migrate-1.2.1.js"></script><!--jquery1.9 以上补丁-->
<script type="text/javascript">
    var uploadUrl="/file/uploadfile?shopId=${shopId!}&type=d";
    var browserUrl="/file/browser?shopId=${shopId!}";
</script>
<script src="https://static.9hive.cn/global/vendor/file/file.js"></script>
<script type="text/javascript">
    $(function () {
        $("input.browserButton").browser();
    })


</script>

</body>

</html>

